package com.powerteam.service.sys;

import com.github.pagehelper.PageInfo;
import com.powerteam.model.sys.User;
import com.powerteam.vo.Result;
import com.powerteam.vo.ResultData;
import com.powerteam.vo.sys.QueryUserVO;
import com.powerteam.vo.sys.UpdatePasswordVO;

import java.util.List;

/**
 * 用户相关服务接口
 *
 * @author jinming.zhang
 * @version 0.0.1
 * @date 2021/12/30
 */
public interface UserService {

    /**
     * 用户登录接口
     *
     * @param user
     * @return
     */
    ResultData<User> signIn(User user);

    /**
     * 查询用户
     *
     * @param vo
     * @return PageInfo<User>
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    PageInfo<User> find(QueryUserVO vo);

    /**
     * 新增用户
     *
     * @param user
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    Result insert(User user);

    /**
     * 批量删除用户
     *
     * @param ids
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    Result deleteByIds(List<Integer> ids);

    /**
     * 根据用户Id获取用户信息
     *
     * @param userId
     * @return User
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    User findById(Integer userId);

    /**
     * 更新用户
     *
     * @param user
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    User update(User user);

    /**
     * 更新用户状态 (启用/禁用)
     *
     * @param user
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    Result updateStatus(User user);

    /**
     * 检查用户名是否重复
     *
     * @param user
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    Result checkUserName(User user);

    /**
     * 重置密码
     *
     * @param user
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    Result resetPassword(User user);

    /**
     * 修改密码
     *
     * @param vo
     * @return Result
     * @Author jinming.zhang
     * @Date 2022/1/12
     */
    Result updatePassword(UpdatePasswordVO vo);
}
